<?php
class RM_User_ReviewsController extends RM_Controller
{

    // this example was taken from amenities.
    // there are two types of controller actions...

    // JSON - getunitamenitiesJsonAction - this returns JSON data

    // Action - showamenitiesAction - for rendering views or handling non JSON data responses.


//    public function getunitamenitiesJsonAction(){
//        $unitID =  $this->_getParam('unitID');
//        $iso = $this->_getParam('iso', RM_Environment::getInstance()->getLocale());
//        $model = new RM_Amenities();
//        $amenitiesArray = $model->getbyUnit($unitID,$iso);
//
//        $config = new RM_AmenitiesConfig();
//        $settings = $config->fetchAll("id='1'")->current()->toArray();
//
//        return array(
//            'data' => array("amenities"=>$amenitiesArray,'config' => $settings)
//        );
//    }
//
//    public function showamenitiesAction(){
//        ob_clean();
//        $unitID = $this->_getParam('unit_id');
//
//        $iso = $this->_getParam('iso', RM_Environment::getInstance()->getLocale());
//        $model = new RM_Amenities();
//        $amenitiesArray = $model->getbyUnit($unitID,$iso);
//
//        $config = new RM_AmenitiesConfig();
//        $settings = $config->fetchAll("id='1'")->current()->toArray();
//
//        $this->view->amenityData = $amenitiesArray;
//        $this->view->config = $settings;
//
//        // call the view
//        echo $this->view->render('Amenities/amenities.phtml');
//        die();
//    }

    public function showreviewsAction(){
        ob_clean();

        // code to get reviews etc...

        echo $this->view->render('Reviews/unitreview.phtml');
        die();
    }
}